//----------------------The Weapon Shop Buying Menu-----------
//....Actually this is the shop for anything, but I did it for weapons first
//and later for any type of store.  I really don't want to change all the
//'WeaponShop' stuff.
function WeaponShopmenu()
{
eatKey();
RenderMap();
 
WindowStyle.drawWindow(8, 8, 624, 12);
Font.drawText(10, 10, WeaponStore.name);

WindowStyle.drawWindow(8, 450, 150, 15);
Font.drawText(13, 455, "Gold: " + Player.gp + "Gp");

// execute the menu
var WeaponShopMenu = new Menu();
WeaponShopMenu.font         = Font;
WeaponShopMenu.window_style = WindowStyle;
WeaponShopMenu.arrow        = Arrow;
WeaponShopMenu.addItem("Buy",  WeaponShopMenu_Buy);
WeaponShopMenu.addItem("Sell",  WeaponShopMenu_Sell);
WeaponShopMenu.addItem("Exit", WeaponShopMenu_Exit);
WeaponShopMenu.execute(6, 34, 72, 40);
}

function WeaponShopMenu_Exit()
{
}
function WeaponShopMenu_Sell()
{
eatKey();
RenderMap();
 
WindowStyle.drawWindow(8, 8, 95, 12);
Font.drawText(10, 10, "Sell what?");

WindowStyle.drawWindow(8, 450, 150, 15);
Font.drawText(13, 455, "Gold: " + Player.gp + "Gp");

// execute the menu
var WeaponSellMenu = new Menu();
WeaponSellMenu.font         = Font;
WeaponSellMenu.window_style = WindowStyle;
WeaponSellMenu.arrow        = Arrow;

//Sell Weapons...

if (Playerweapons.Dagger >= 1)
{
WeaponSellMenu.addItem("Dagger: " + Playerweapons.Dagger + " - 25Gp",  WeaponStoreSellDagger);
}
if (Playerweapons.Dirk >= 1)
{
WeaponSellMenu.addItem("Dirk: " + Playerweapons.Dirk + " - 50Gp",  WeaponStoreSellDirk);
}
if (Playerweapons.Short_Sword >= 1)
{
WeaponSellMenu.addItem("Short Sword: " + Playerweapons.Short_Sword + " - 75Gp",  WeaponStoreSellShort_Sword);
}
if (Playerweapons.MithrilKnife >= 1)
{
WeaponSellMenu.addItem("Mithril Knife: " + Playerweapons.MithrilKnife + " - 750Gp",  WeaponStoreSellMithrilKnife);
}
if (Playerweapons.ConqudorKnife >= 1)
{
WeaponSellMenu.addItem("Conqudor Knife: " + Playerweapons.ConqudorKnife + " - 1Gp",  WeaponStoreSellConqudorKnife);
}

if (Playerweapons.Long_Sword >= 1)
{
WeaponSellMenu.addItem("Long Sword: " + Playerweapons.Long_Sword + " - 175Gp",  WeaponStoreSellLong_Sword);
}
if (Playerweapons.BroadSword >= 1)
{
WeaponSellMenu.addItem("Broad Sword: " + Playerweapons.BroadSword + " - 625Gp",  WeaponStoreSellBroadSword);
}
if (Playerweapons.RegalSword >= 1)
{
WeaponSellMenu.addItem("Regal Sword: " + Playerweapons.RegalSword + " - 1500Gp",  WeaponStoreSellRegalSword);
}
if (Playerweapons.MithrilBlade >= 1)
{
WeaponSellMenu.addItem("Mithril Blade: " + Playerweapons.MithrilBlade + " - 3750Gp",  WeaponStoreSellMithrilBlade);
}
if (Playerweapons.AdamantineBlade >= 1)
{
WeaponSellMenu.addItem("Adamantine Blade: " + Playerweapons.AdamantineBlade + " - 1Gp",  WeaponStoreSellAdamantineBlade);
}
if (Playerweapons.LegendSword >= 1)
{
WeaponSellMenu.addItem("Legend Sword: " + Playerweapons.LegendSword + " - 1Gp",  WeaponStoreSellLegendSword);
}

if (Playerweapons.WooodenStaff >= 1)
{
WeaponSellMenu.addItem("Wooden Staff: " + Playerweapons.WoodenStaff + " - 60Gp",  WeaponStoreSellWoodenStaff);
}
if (Playerweapons.BattleStaff >= 1)
{
WeaponSellMenu.addItem("Battle Staff: " + Playerweapons.BattleStaff + " - 400Gp",  WeaponStoreSellBattleStaff);
}
if (Playerweapons.MetalStaff >= 1)
{
WeaponSellMenu.addItem("Metal Staff: " + Playerweapons.MetalStaff + " - 1500Gp",  WeaponStoreSellMetalStaff);
}
if (Playerweapons.MageStaff >= 1)
{
WeaponSellMenu.addItem("Mage Staff: " + Playerweapons.MageStaff + " - 1Gp",  WeaponStoreSellMageStaff);
}

//Sell Armour...
if (Playerweapons.Lh_Armour >= 1)
{
WeaponSellMenu.addItem("Leather Armour: " + Playerweapons.Lh_Armour + " - 100Gp",  WeaponStoreSellLh_Armour);
}
if (Playerweapons.StudLh_Armour >= 1)
{
WeaponSellMenu.addItem("Studded Leather Armour: " + Playerweapons.StudLh_Armour + " - 175Gp",  WeaponStoreSellStudLh_Armour);
}
if (Playerweapons.IronPlate >= 1)
{
WeaponSellMenu.addItem("Iron Plate: " + Playerweapons.IronPlate + " - 375Gp",  WeaponStoreSellIronPlate);
}
if (Playerweapons.SilverVest >= 1)
{
WeaponSellMenu.addItem("Silver Vest: " + Playerweapons.SilverVest + " - 750Gp",  WeaponStoreSellSilverVest);
}
if (Playerweapons.SilverPlate >= 1)
{
WeaponSellMenu.addItem("Silver Plate: " + Playerweapons.SilverPlate + " - 1000Gp",  WeaponStoreSellSilverPlate);
}
if (Playerweapons.SteelPlate >= 1)
{
WeaponSellMenu.addItem("Steel Plate: " + Playerweapons.SteelPlate + " - 2000Gp",  WeaponStoreSellSteelPlate);
}
if (Playerweapons.BronzeVest >= 1)
{
WeaponSellMenu.addItem("Bronze Vest: " + Playerweapons.BronzeVest + " - 2750Gp",  WeaponStoreSellBronzeVest);
}
if (Playerweapons.BronzePlate >= 1)
{
WeaponSellMenu.addItem("Bronze Plate: " + Playerweapons.BronzePlate + " - 3250Gp",  WeaponStoreSellBronzePlate);
}
if (Playerweapons.MithrilVest >= 1)
{
WeaponSellMenu.addItem("Mithril Vest: " + Playerweapons.MithrilVest + " - 5000Gp",  WeaponStoreSellMithrilVest);
}
if (Playerweapons.MithrilPlate >= 1)
{
WeaponSellMenu.addItem("Mithril Plate: " + Playerweapons.MithrilPlate + " - 6000Gp",  WeaponStoreSellMithrilPlate);
}
if (Playerweapons.GoldPlate >= 1)
{
WeaponSellMenu.addItem("Gold Plate: " + Playerweapons.GoldPlate + " - 7500Gp",  WeaponStoreSellGoldPlate);
}
if (Playerweapons.PlatinumPlate >= 1)
{
WeaponSellMenu.addItem("Platinum Plate: " + Playerweapons.PlatinumPlate + " - 10000Gp",  WeaponStoreSellPlatinumPlate);
}
if (Playerweapons.AdamantinePlate >= 1)
{
WeaponSellMenu.addItem("Adamantine Plate: " + Playerweapons.AdamantinePlate + " - 1Gp",  WeaponStoreSellAdamantinePlate);
}
if (Playerweapons.AncientPlate >= 1)
{
WeaponSellMenu.addItem("Ancient Plate: " + Playerweapons.AncientPlate + " - 1Gp",  WeaponStoreSellAncientPlate);
}
if (Playerweapons.Cloak >= 1)
{
WeaponSellMenu.addItem("Cloak: " + Playerweapons.Cloak + " - 25Gp",  WeaponStoreSellCloak);
}
if (Playerweapons.CottonRobe >= 1)
{
WeaponSellMenu.addItem("Cotton Robe: " + Playerweapons.CottonRobe + " - 75Gp",  WeaponStoreSellCottonRobe);
}
if (Playerweapons.SilkRobe >= 1)
{
WeaponSellMenu.addItem("Silk Robe: " + Playerweapons.SilkRobe + " - 1500Gp",  WeaponStoreSellSilkRobe);
}

//Sell Items
if (Player.items.potion >= 1)
{
WeaponSellMenu.addItem("Potion: " + Player.items.potion + " - 25Gp",  WeaponStoreSellPotion);
}
if (Player.items.hipotion >= 1)
{
WeaponSellMenu.addItem("Hi-Potion: " + Player.items.hipotion + " - 100Gp",  WeaponStoreSellHiPotion);
}
if (Player.items.fullpotion >= 1)
{
WeaponSellMenu.addItem("Full Potion: " + Player.items.fullpotion + " - 1Gp",  WeaponStoreSellFullPotion);
}
if (Player.items.ether >= 1)
{
WeaponSellMenu.addItem("Ether: " + Player.items.ether + " - 500Gp",  WeaponStoreSellEther);
}
if (Player.items.turboether >= 1)
{
WeaponSellMenu.addItem("Turbo Ether: " + Player.items.turboether + " - 1Gp",  WeaponStoreSellTurboEther);
}
if (Player.items.life >= 1)
{
WeaponSellMenu.addItem("Life: " + Player.items.life + " - 250Gp",  WeaponStoreSellLife);
}
if (Player.items.elixer >= 1)
{
WeaponSellMenu.addItem("Elixer: " + Player.items.elixer + " - 1Gp",  WeaponStoreSellElixer);
}
if (Player.items.tent >= 1)
{
WeaponSellMenu.addItem("Tent: " + Player.items.tent + " - 250Gp",  WeaponStoreSellTent);
}


WeaponSellMenu.addItem("Cancel",  WeaponShopmenu);

WeaponSellMenu.execute(6, 34, 342, 340);
}


//Weapon sell..
function WeaponStoreSellDagger()
{
Player.gp = Player.gp + 25;
Playerweapons.Dagger = Playerweapons.Dagger - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellDirk()
{
Player.gp = Player.gp + 100;
Playerweapons.Dirk = Playerweapons.Dirk - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellShort_Sword()
{
Player.gp = Player.gp + 75;
Playerweapons.Short_Sword = Playerweapons.Short_Sword - 1;
WeaponShopMenu_Sell();
}

function WeaponStoreMithrilKnife()
{
Player.gp = Player.gp + 750;
Playerweapons.MithrilKnife = Playerweapons.MithilKnife - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreConqudorKnife()
{
Player.gp = Player.gp + 1;
Playerweapons.ConqudorKnife = Playerweapons.ConqudorKnife - 1;
WeaponShopMenu_Sell();
}

function WeaponStoreSellLong_Sword()
{
Player.gp = Player.gp + 150;
Playerweapons.Long_Sword = Playerweapons.Long_Sword - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellBroadSword()
{
Player.gp = Player.gp + 625;
Playerweapons.BroadSword = Playerweapons.BroadSword - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellRegalSword()
{
Player.gp = Player.gp + 1500;
Playerweapons.RegalSword = Playerweapons.RegalSword - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellMithrilBlade()
{
Player.gp = Player.gp + 3750;
Playerweapons.MithrilBlade = Playerweapons.MithrilBlade - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellAdamantineBlade()
{
Player.gp = Player.gp + 1;
Playerweapons.AdamantineBlade = Playerweapons.AdamantineBlade - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellLegendSword()
{
Player.gp = Player.gp + 1;
Playerweapons.LegendSword = Playerweapons.LegendSword - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellWoodenStaff()
{
Player.gp = Player.gp + 60;
Playerweapons.WoodenStaff = Playerweapons.WoodenStaff - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellBattleStaff()
{
Player.gp = Player.gp + 400;
Playerweapons.BattleStaff = Playerweapons.BattleStaff - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellMetalStaff()
{
Player.gp = Player.gp + 1500;
Playerweapons.MetalStaff = Playerweapons.MetalStaff - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellMageStaff()
{
Player.gp = Player.gp + 1;
Playerweapons.MageStaff = Playerweapons.MageStaff - 1;
WeaponShopMenu_Sell();
}

//Armour sell..
function WeaponStoreSellLh_Armour()
{
Player.gp = Player.gp + 100;
Playerweapons.Lh_Armour = Playerweapons.Lh_Armour - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellStudLh_Armour()
{
Player.gp = Player.gp + 175;
Playerweapons.StudLh_Armour = Playerweapons.StudLh_Armour - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellIronPlate()
{
Player.gp = Player.gp + 375;
Playerweapons.IronPlate = Playerweapons.IronPlate - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellSilverVest()
{
Player.gp = Player.gp + 750;
Playerweapons.SilverVest = Playerweapons.SilverVest - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellSilverPlate()
{
Player.gp = Player.gp + 1000;
Playerweapons.SilverPlate = Playerweapons.SilverPlate - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellSteelPlate()
{
Player.gp = Player.gp + 2000;
Playerweapons.SteelPlate = Playerweapons.SteelPlate - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellBronzeVest()
{
Player.gp = Player.gp + 2750;
Playerweapons.BronzeVest = Playerweapons.BronzeVest - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellBronzePlate()
{
Player.gp = Player.gp + 3250;
Playerweapons.BronzePlate = Playerweapons.BronzePlate - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellMithrilVest()
{
Player.gp = Player.gp + 5000;
Playerweapons.MithrilVest = Playerweapons.MithrilVest - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellMithrilPlate()
{
Player.gp = Player.gp + 6000;
Playerweapons.MithrilPlate = Playerweapons.MithrilPlate - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellGoldPlate()
{
Player.gp = Player.gp + 7500;
Playerweapons.GoldPlate = Playerweapons.GoldPlate - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellPlatinumPlate()
{
Player.gp = Player.gp + 10000;
Playerweapons.PlatinumPlate = Playerweapons.PlatinumPlate - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellAdamantinePlate()
{
Player.gp = Player.gp + 1;
Playerweapons.AdamantinePlate = Playerweapons.AdamantinePlate - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellAncientPlate()
{
Player.gp = Player.gp + 1;
Playerweapons.AncientPlate = Playerweapons.AncientPlate - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellDemonPlate()
{
Player.gp = Player.gp + 1;
Playerweapons.DemonPlate = Playerweapons.DemonPlate - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellAnglicPlate()
{
Player.gp = Player.gp + 1;
Playerweapons.AnglicPlate = Playerweapons.AnglicPlate - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellCloak()
{
Player.gp = Player.gp + 1;
Playerweapons.Cloak = Playerweapons.Cloak - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellCottonRobe()
{
Player.gp = Player.gp + 75;
Playerweapons.CottonRobe = Playerweapons.CottonRobe - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellSilkRobe()
{
Player.gp = Player.gp + 2500;
Playerweapons.SilkRobe = Playerweapons.SilkRobe - 1;
WeaponShopMenu_Sell();
}

//Item sell..
function WeaponStoreSellPotion()
{
Player.gp = Player.gp + 25;
Player.items.potion = Player.items.potion - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellHiPotion()
{
Player.gp = Player.gp + 100;
Player.items.hipotion = Player.items.hipotion - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellFullPotion()
{
Player.gp = Player.gp + 1;
Player.items.fullpotion = Player.items.fullpotion - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellEther()
{
Player.gp = Player.gp + 500;
Player.items.ether = Player.items.ether - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellTurboEther()
{
Player.gp = Player.gp + 1;
Player.items.turboether = Player.items.turboether - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellElixer()
{
Player.gp = Player.gp + 1;
Player.items.elixer = Player.items.elixer - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellLife()
{
Player.gp = Player.gp + 250;
Player.items.life = Player.items.life - 1;
WeaponShopMenu_Sell();
}
function WeaponStoreSellTent()
{
Player.gp = Player.gp + 250;
Player.items.tent = Player.items.tent - 1;
WeaponShopMenu_Sell();
}

function WeaponShopMenu_Buy()
{
RenderMap();
eatKey(); 
WindowStyle.drawWindow(8, 8, 624, 12);
Font.drawText(10, 10, WeaponStore.name);

WindowStyle.drawWindow(8, 450, 150, 15);
Font.drawText(13, 455, "Gold: " + Player.gp + "Gp");

// execute the menu
var WeaponBuyMenu = new Menu();
WeaponBuyMenu.font         = Font;
WeaponBuyMenu.window_style = WindowStyle;
WeaponBuyMenu.arrow        = Arrow;

WeaponBuyMenu.addItem(WeaponStore.weapon1 + " Cost: " + WeaponStore.weapon1cost + "Gp",  WeaponStorebuyweapon1);

if (WeaponStore.num >= 2)
  {
    WeaponBuyMenu.addItem(WeaponStore.weapon2 + " Cost: " + WeaponStore.weapon2cost + "Gp",  WeaponStorebuyweapon2);
  }
if (WeaponStore.num >= 3)
  {
    WeaponBuyMenu.addItem(WeaponStore.weapon3 + " Cost: " + WeaponStore.weapon3cost + "Gp",  WeaponStorebuyweapon3);
  }
if (WeaponStore.num >= 4)
  {
    WeaponBuyMenu.addItem(WeaponStore.weapon4 + " Cost: " + WeaponStore.weapon4cost + "Gp",  WeaponStorebuyweapon4);
  }
if (WeaponStore.num >= 5)
  {
    WeaponBuyMenu.addItem(WeaponStore.weapon5 + " Cost: " + WeaponStore.weapon5cost + "Gp",  WeaponStorebuyweapon5);
  }
if (WeaponStore.num >= 6)
  {
    WeaponBuyMenu.addItem(WeaponStore.weapon6 + " Cost: " + WeaponStore.weapon6cost + "Gp",  WeaponStorebuyweapon6);
  }
if (WeaponStore.num >= 7)
  {
    WeaponBuyMenu.addItem(WeaponStore.weapon7 + " Cost: " + WeaponStore.weapon7cost + "Gp",  WeaponStorebuyweapon7);
  }
if (WeaponStore.num >= 8)
  {
    WeaponBuyMenu.addItem(WeaponStore.weapon8 + " Cost: " + WeaponStore.weapon8cost + "Gp",  WeaponStorebuyweapon8);
  }
if (WeaponStore.num >= 9)
  {
    WeaponBuyMenu.addItem(WeaponStore.weapon9 + " Cost: " + WeaponStore.weapon9cost + "Gp",  WeaponStorebuyweapon9);
  }
if (WeaponStore.num >= 10)
  {
    WeaponBuyMenu.addItem(WeaponStore.weapon10 + " Cost: " + WeaponStore.weapon10cost + "Gp",  WeaponStorebuyweapon10);
  }
  
WeaponBuyMenu.addItem("Exit", WeaponShopMenu_Exit);
WeaponBuyMenu.execute(6, 34, 372, 120);

}

function WeaponShopMenu_Exit()
{
}

function WeaponStorebuyweapon1()
{
  if (Player.gp < WeaponStore.weapon1cost)
  {
    Talk_Window("You don't have enough money", "blank.png");
    WeaponShopMenu_Buy();
  }
  else
  {
    Playerweapons.temp = WeaponStore.weapon1
    Playerweapons.tempcost = WeaponStore.weapon1cost
    Acceptweapon();
  }
}
function WeaponStorebuyweapon2()
{
  if (Player.gp < WeaponStore.weapon2cost)
  {
    Talk_Window("You don't have enough money", "blank.png");
    WeaponShopMenu_Buy();
  }
  else
  {
    Playerweapons.temp = WeaponStore.weapon2
    Playerweapons.tempcost = WeaponStore.weapon2cost
    Acceptweapon();
  }
}
function WeaponStorebuyweapon3()
{
  if (Player.gp < WeaponStore.weapon3cost)
  {
    Talk_Window("You don't have enough money", "blank.png");
    WeaponShopMenu_Buy();
  }
  else
  {
    Playerweapons.temp = WeaponStore.weapon3
    Playerweapons.tempcost = WeaponStore.weapon3cost
    Acceptweapon();
  }
}
function WeaponStorebuyweapon4()
{
  if (Player.gp < WeaponStore.weapon4cost)
  {
    Talk_Window("You don't have enough money", "blank.png");
    WeaponShopMenu_Buy();
  }
  else
  {
    Playerweapons.temp = WeaponStore.weapon4
    Playerweapons.tempcost = WeaponStore.weapon4cost
    Acceptweapon();
  }
}
function WeaponStorebuyweapon5()
{
  if (Player.gp < WeaponStore.weapon5cost)
  {
    Talk_Window("You don't have enough money", "blank.png");
    WeaponShopMenu_Buy();
  }
  else
  {
    Playerweapons.temp = WeaponStore.weapon5
    Playerweapons.tempcost = WeaponStore.weapon5cost
    Acceptweapon();
  }
}
function WeaponStorebuyweapon6()
{
  if (Player.gp < WeaponStore.weapon6cost)
  {
    Talk_Window("You don't have enough money", "blank.png");
    WeaponShopMenu_Buy();
  }
  else
  {
    Playerweapons.temp = WeaponStore.weapon6
    Playerweapons.tempcost = WeaponStore.weapon6cost
    Acceptweapon();
  }
}

function WeaponStorebuyweapon7()
{
  if (Player.gp < WeaponStore.weapon7cost)
  {
    Talk_Window("You don't have enough money", "blank.png");
    WeaponShopMenu_Buy();
  }
  else
  {
    Playerweapons.temp = WeaponStore.weapon7
    Playerweapons.tempcost = WeaponStore.weapon7cost
    Acceptweapon();
  }
}
function WeaponStorebuyweapon8()
{
  if (Player.gp < WeaponStore.weapon8cost)
  {
    Talk_Window("You don't have enough money", "blank.png");
    WeaponShopMenu_Buy();
  }
  else
  {
    Playerweapons.temp = WeaponStore.weapon8
    Playerweapons.tempcost = WeaponStore.weapon8cost
    Acceptweapon();
  }
}

function WeaponStorebuyweapon9()
{
  if (Player.gp < WeaponStore.weapon9cost)
  {
    Talk_Window("You don't have enough money", "blank.png");
    WeaponShopMenu_Buy();
  }
  else
  {
    Playerweapons.temp = WeaponStore.weapon9
    Playerweapons.tempcost = WeaponStore.weapon9cost
    Acceptweapon();
  }
}
function WeaponStorebuyweapon10()
{
  if (Player.gp < WeaponStore.weapon10cost)
  {
    Talk_Window("You don't have enough money", "blank.png");
    WeaponShopMenu_Buy();
  }
  else
  {
    Playerweapons.temp = WeaponStore.weapon10
    Playerweapons.tempcost = WeaponStore.weapon10cost
    Acceptweapon();
  }
}

function Acceptweapon()
{
Player.gp = Player.gp - Playerweapons.tempcost
//Knives
  if (Playerweapons.temp == "Dagger")
  {
    Playerweapons.Dagger = Playerweapons.Dagger + 1;
  }    
  else if (Playerweapons.temp == "Dirk")
  {
    Playerweapons.Dirk = Playerweapons.Dirk + 1;
  }
  else if (Playerweapons.temp == "Short Sword")
  {
    Playerweapons.Short_Sword = Playerweapons.Short_Sword + 1;
  }    
  else if (Playerweapons.temp == "Mithril Knife")
  {
    Playerweapons.MithrilKnife = Playerweapons.MithrilKnife + 1;
  }
  else if (Playerweapons.temp == "Conqudor Knife")
  {
    Playerweapons.ConqudorKnife = Playerweapons.ConqudorKnife + 1;
  }    

//Swords
  else if (Playerweapons.temp == "Long Sword")
  {
    Playerweapons.Long_Sword = Playerweapons.Long_Sword + 1;
  }
  else if (Playerweapons.temp == "Broad Sword")
  {
    Playerweapons.BroadSword = Playerweapons.BroadSword + 1;
  }
  else if (Playerweapons.temp == "Regal Sword")
  {
    Playerweapons.RegalSword = Playerweapons.RegalSword + 1;
  }
  else if (Playerweapons.temp == "Mithril Blade")
  {
    Playerweapons.MithrilBlade = Playerweapons.MithrilBlade + 1;
  }
  else if (Playerweapons.temp == "Adamantine Blade")
  {
    Playerweapons.AdamantineBlade = Playerweapons.AdamantineBlade + 1;
  }
  else if (Playerweapons.temp == "Legend Sword")
  {
    Playerweapons.LegendSword = Playerweapons.LegendSword + 1;
  }


//Staves
  else if (Playerweapons.temp == "Wooden Staff")
  {
    Playerweapons.WoodenStaff = Playerweapons.WoodenStaff + 1;
  }
  else if (Playerweapons.temp == "Battle Staff")
  {
    Playerweapons.BattleStaff = Playerweapons.BattleStaff + 1;
  }
  else if (Playerweapons.temp == "Metal Staff")
  {
    Playerweapons.MetalStaff = Playerweapons.MetalStaff + 1;
  }
  else if (Playerweapons.temp == "Mage Staff")
  {
    Playerweapons.MageStaff = Playerweapons.MageStaff + 1;
  }
//Armour
  else if (Playerweapons.temp == "Leather Armour")
  {
    Playerweapons.Lh_Armour = Playerweapons.Lh_Armour + 1;
  }    
  else if (Playerweapons.temp == "Studded Leather Armour")
  {
    Playerweapons.StudLh_Armour = Playerweapons.StudLh_Armour + 1;
  }    
  else if (Playerweapons.temp == "Iron Plate")
  {
    Playerweapons.IronPlate = Playerweapons.IronPlate + 1;
  }
  else if (Playerweapons.temp == "Silver Vest")
  {
    Playerweapons.SilverVest = Playerweapons.SilverVest + 1;
  }
  else if (Playerweapons.temp == "Silver Plate")
  {
    Playerweapons.SilverPlate = Playerweapons.SilverPlate + 1;
  }
  else if (Playerweapons.temp == "Steel Plate")
  {
    Playerweapons.SteelPlate = Playerweapons.SteelPlate + 1;
  }
  else if (Playerweapons.temp == "Bronze Vest")
  {
    Playerweapons.BronzeVest = Playerweapons.BronzeVest + 1;
  }
  else if (Playerweapons.temp == "Bronze Plate")
  {
    Playerweapons.BronzePlate = Playerweapons.BronzePlate + 1;
  }
  else if (Playerweapons.temp == "Mithril Vest")
  {
    Playerweapons.MithrilVest = Playerweapons.MithrilVest + 1;
  }
  else if (Playerweapons.temp == "Mithril Plate")
  {
    Playerweapons.MithrilPlate = Playerweapons.MithrilPlate + 1;
  }
  else if (Playerweapons.temp == "Gold Plate")
  {
    Playerweapons.GoldPlate = Playerweapons.GoldPlate + 1;
  }
  else if (Playerweapons.temp == "Platinum Plate")
  {
    Playerweapons.PlatinumPlate = Playerweapons.PlatinumPlate + 1;
  }
  else if (Playerweapons.temp == "Adamantine Plate")
  {
    Playerweapons.AdamantinePlate = Playerweapons.AdamantinePlate + 1;
  }
  else if (Playerweapons.temp == "Ancient Plate")
  {
    Playerweapons.AncientPlate = Playerweapons.AncientPlate + 1;
  }
  else if (Playerweapons.temp == "Cloak")
  {
    Playerweapons.Cloak = Playerweapons.Cloak + 1;
  }
  else if (Playerweapons.temp == "Cotton Robe")
  {
    Playerweapons.CottonRobe = Playerweapons.CottonRobe + 1;
  }
  else if (Playerweapons.temp == "Silk Robe")
  {
    Playerweapons.SilkRobe = Playerweapons.SilkRobe + 1;
  }
  else if (Playerweapons.temp == "Demon Plate")
  {
    Playerweapons.DemonPlate = Playerweapons.DemonPlate + 1;
  }
  else if (Playerweapons.temp == "Anglic Plate")
  {
    Playerweapons.AnglicPlate = Playerweapons.AnglicPlate + 1;
  }

//Items
  else if (Playerweapons.temp == "Potion")
  {
    Player.items.potion = Player.items.potion + 1;
  }  
  else if (Playerweapons.temp == "Hi-Potion")
  {
    Player.items.hipotion = Player.items.hipotion + 1;
  }  
  else if (Playerweapons.temp == "Full Potion")
  {
    Player.items.hipotion = Player.items.hipotion + 1;
  }  
  else if (Playerweapons.temp == "Ether")
  {
    Player.items.ether = Player.items.ether + 1;
  }  
  else if (Playerweapons.temp == "Turbo Ether")
  {
    Player.items.turboether = Player.items.turboether + 1;
  }
  else if (Playerweapons.temp == "Elixer")
  {
    Player.items.elixer = Player.items.elixer + 1;
  }
  else if (Playerweapons.temp == "Tent")
  {
    Player.items.tent = Player.items.tent + 1;
  }
  else if (Playerweapons.temp == "Life")
  {
    Player.items.life = Player.items.life + 1;
  }
  else if (Playerweapons.temp == "Potion x10")
  {
    Player.items.potion = Player.items.potion + 10;
  }
  else if (Playerweapons.temp == "Tent x10")
  {
    Player.items.tent = Player.items.tent + 10;
  }
  else if (Playerweapons.temp == "Hi-Potion x10")
  {
    Player.items.hipotion = Player.items.hipotion + 10;
  }  
WeaponShopmenu();
}

function WeaponShopMenu_Exit()
{
}
